//
//  TicTacGrid.h
//  TicTacToe
//
//  Created by Tim on 09-11-22.
//  Copyright 2009 Tim Dimsdale. All rights reserved.
//
// This file is part of TicTacToe.
// 
// TicTacToe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// TicTacToe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with TicTacToe.  If not, see <http://www.gnu.org/licenses/>
//
#import <Cocoa/Cocoa.h>
#import "TicTacModel.h"

#define GRID_SPACING 100.0
#define GRID_OFFSET_LEFT 10.0
#define GRID_OFFSET_TOP 10.0

#define GRID_MAX_HEIGHT 100.0
#define GRID_MAX_WIDTH 100.0

#define GRID_LINE_WIDTH 4
#define GRID_PEOPLE_WIDTH 10
#define GRID_WINLINE_WIDTH 20

#define CELL_SPACING 20

/*!
 \brief The TicTacGrid is responsible for drawing the the grid, and peices within the grid.
 
 TicTacGrid is expected to be used within the view.  All it does is draw, there is no 
 input or interaction of any kind.
 */
@interface TicTacGrid : NSObject {

}

/*!
 \brief The main drawing method expected to be called from the tic tac view.
 This will take responsability for ensuring the lines, players, and any winning strokes are drawn.
 \param rect The rectangle to draw within
 \param model The data model to reference while drawing
 \param isEnabled A flag to indicate whether the grid is enabled.
 */
-(void)drawGrid:(NSRect)rect  withModel:(TicTacModel *)model enabled:(bool)isEnabled;
/*!
 \brief Internal use.
 Draws the vertical lines.  Use drawGrid 
 */
-(void)drawVerticalLines : (NSRect) rect  enabled:(bool)isEnabled;

/*!
 \brief Internal use.
 Draws the horizontal lines.  Use drawGrid 
 */
-(void)drawHorizontalLines : (NSRect) rect  enabled:(bool)isEnabled;

/*!
 \brief Internal use.
 Draws the players ( x's and o's).  Use drawGrid 
 */
-(void) drawPlayers: (TicTacModel *) model  withCellWidth:(double)cellWidth andCellHeight:(double)cellHeight;

/*!
 \brief Internal use.
 Draws any winning lines.  If multiple wins then multiple draws.  Use drawGrid 
 */
- (void) drawWinningLines: (double) cellHeight cellWidth: (double) cellWidth model: (TicTacModel *) model;

/*!
 \brief Internal use.
 Draws an x player.  Use drawGrid 
 */
-(void) drawPlayerXAtX: (double)xMin yMin:(double)yMin xMax:(double)xMax yMax:(double)yMax;
/*!
 \brief Internal use.
 Draws an o player.  Use drawGrid 
 */
-(void) drawPlayerOAtX: (double) xMin yMin:(double)yMin width:(double)width height:(double)height;

@end
